-
Notifications
You must be signed in to change notification settings - Fork 477
feat(expo-cli): add shortcut to open editor #1879
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1879 +/- ##
=======================================
Coverage 59.95% 59.95%
=======================================
Files 84 84
Lines 2502 2502
Branches 687 694 +7
=======================================
Hits 1500 1500
+ Misses 979 972 -7
- Partials 23 30 +7
Continue to review full report at Codecov.
|
@@ -4178,11 +4178,6 @@ | |||
dependencies: | |||
"@types/node" "*" | |||
|
|||
"@types/caseless@*": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what's going on here, looks like the yarn lockfile could be slightly outdated?
we have previously used the the old script for this is here: expo-cli/packages/xdl/src/FileSystem.ts Lines 47 to 55 in cc9e1d8
i wonder why we chose to use |
Fixes #1762
This uses Sindre's
env-editor
andspawnAsync
over some other options I've tried. The env editor basically tries to find the default editor, if that's not found it will fallback to vscode. If none of these 2 options work, it will log with an error and describes how to fix it.I tested this on MacOS, Windows and Windows WSL 😄
Fun facts(tm)
open-editor
didn't work that well for folders on both MacOS and Windows. On MacOS it thought it was a file and appended line and colon (/my/path:1:1
) to this. On Windows there were some errors with--goto
flag.open
didn't work on MacOS, apparently MacOS can't open vscode withopen /my/path -a vscode
(but does work withopen /my/path -a "Visual Studio Code"
). Alsoopen
didn't reject the first attempt, it resolved without errors.